package muse.frames;

import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import muse.Frame;
import muse.widgets.CalendarWidget;
import muse.widgets.MuseWidget;
import muse.widgets.TextboxWidget;

public class Journal extends Frame {

    CalendarWidget calendarPane;
    TextboxWidget textPane;
    MuseWidget musePane;
    
    public Journal()
    {
        this.setLayout(new BorderLayout());
        
        //Panel for filling the entire screen
        JPanel all = new JPanel();
        
        //apply gridbaglayout and initialize constraints parameter
        all.setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();     
        
        //create the calendar panel and set its constraints, then add
        calendarPane = new CalendarWidget();
        calendarPane.setBorder(BorderFactory.createLineBorder(Color.green));
        c.fill = GridBagConstraints.BOTH;
        c.ipady = (int)(480*0.70)/2;
        c.weightx = 1.0;
        c.weighty = 1.0;
        c.gridwidth = 2;
        c.gridheight = 2;
        c.gridx = 0;
        c.gridy = 0;
        c.insets = new Insets(5, 5, 5, 5);
        all.add(calendarPane, c);
        
        //creating muse panel
        musePane = new MuseWidget();
        musePane.setBorder(BorderFactory.createLineBorder(Color.blue));
        c.fill = GridBagConstraints.BOTH;
        c.ipady = 0;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 2;
        c.ipady = 0;
        all.add(musePane, c);
        
        //creating text panel
        textPane = new TextboxWidget();
        textPane.setPreferredSize(new Dimension(260, 200));
        textPane.setBorder(BorderFactory.createLineBorder(Color.red));
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 1;
        c.gridy = 2;
        
        all.add(textPane, c);
        
        //add the window *filler* "all" panel
        this.add(all);
      
    }
    
    public void init() {
    	super.init();
    	calendarPane.refresh();
    }
}

